package cn.pli.bike.ui;

import android.content.Intent;
import android.os.Message;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import org.greenrobot.eventbus.EventBus;

import cn.bingoogolapple.androidcommon.adapter.BGARecyclerViewAdapter;
import cn.bingoogolapple.androidcommon.adapter.BGAViewHolderHelper;
import cn.pli.bike.App;
import cn.pli.bike.R;
import cn.pli.bike.bean.EventAction;
import cn.pli.bike.bean.ProblemBean;

/**
 * Created by shangdongzhou on 2017/11/19.
 */

public class CommonProblemInfoAdapter extends BGARecyclerViewAdapter<ProblemBean.DetailProblemBean> {


    public CommonProblemInfoAdapter(RecyclerView recyclerView) {
        super(recyclerView, R.layout.item_call_center_common_problem_detail_info);
    }


    @Override
    protected void fillData(BGAViewHolderHelper helper, int position, final ProblemBean.DetailProblemBean model) {
        TextView tvDetail = helper.getTextView(R.id.tv_detail_link_info);
        tvDetail.setText(model.getTitle());
        tvDetail.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Message message = new Message();
                message.what = EventAction.ACTION_COMMON_PROBLEM;
                message.obj = model;
                EventBus.getDefault().post(message);
            }
        });

    }


}
